package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-23
 * Time: 12:58
 */
public class Dog extends Animal{
    static {
        System.out.println("Dog的静态代码块");
    }
    {
        System.out.println("Dog的实例化代码块");
    }
    public Dog(String name, int age) {
        super(name, age);
        System.out.println("Dog的构造函数Dog()");
    }

    protected void eat() {
        System.out.println("Dog::eat()...");
    }
    protected void bark() {
        this.eat();
        super.eat();
        System.out.println(this.name + "在狗叫...");
    }
}
